Conversation
3aedfaf to
aa6ee82
Compare
e9302da to
aa6ee82
Compare
|
Thanks, this is great -- I was looking for this function. Any way we can get this merged so it's easier to use? |
| if (!buf) | ||
| return 0; |
There was a problem hiding this comment.
Duplicate code, it's already defined further down.
There was a problem hiding this comment.
I'll fix this up if the maintainers ever consider merging this. Personally I don't see why not but looks like they haven't merged any PRs from non-SolderedElectronics members in years...
There was a problem hiding this comment.
It would be better to keep this earlier one rather than the one below. That prevents a possible memory leak from pngle_new().
| ret = 0; | ||
|
|
||
| pngle_destroy(pngle); | ||
| free(buf); |
There was a problem hiding this comment.
Neither drawBitmapFromBuffer() or drawJpegFromBuffer() free the buffers passed into them. In order to be consistent with the existing methods, free(buf); should be removed.
Noticed the library has methods to draw bmp and jpg from buffer but not png, so I added it.
Tried it on my Inkplate10 (v1) and behaves identically to
drawPngFromWebPersonally I need a function like this as I download png data using a custom function (need to also read HTTP headers) and needed a way to write to the display without drawing again from a URL or SD card.